<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<style type="text/css">
	<%@ include file="../stylesheets/main.css" %>
	<%@ include file="../stylesheets/header.css" %>	
	<%@ include file="../stylesheets/register.css" %>	
	<%@ include file="../stylesheets/footer.css" %>	
</style>
<%@ include file="html-header.jsp"%>
<script type="text/javascript">
<%@ include file="../js/register.js" %>
</script>
</head>
<body>
	<div id="left-column-outer">
		<div id="left-column"></div>
	</div>
	<div id="center-column">
		<div class="CenteredContainer">
			<img id="background_noresize" alt="background_noresize"
				src="/Browarex/img/background.jpg">
			<%@ include file="header.jsp"%>
			<div class="ContentShade"></div>
			<div class="RegisterContainer">
				<sf:form method="post" commandName="customer" action="addUser">
					<table>
						<tr class="RegisteTablerMainRow">
							<td class="RegisterLeftColumn"><span class="RegisterLink"><s:message
										code="user.new.account" /></span>
								<table cellpadding="5" cellspacing="5">
									<tr>
									<c:if test="${customer.clientType == 'COMPANY' }">
									<td>Osoba prywatna <input id="radio_private_client" name="client_type" type="radio"
											value="PRIVATE_CUSTOMER"
											onclick="toggle(this)" /> Firma <input id="radio_comapany" name="client_type"
											type="radio" value="COMPANY" onclick="toggle()" checked="checked"/></td>
									</c:if>
									<c:if test="${customer.clientType == 'PRIVATE_CUSTOMER' || customer.clientType == null }">
										<td>Osoba prywatna <input id="radio_private_client" name="client_type" type="radio"
											checked="checked" value="PRIVATE_CUSTOMER"
											onclick="toggle()" /> Firma <input id="radio_comapany" name="client_type"
											type="radio" value="COMPANY" onclick="toggle(this)" /></td>
									</c:if>
									</tr>
									<sf:input id="clientType" path ="clientType" value="" hidden = "true"/>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.login" /> </span> <sf:errors style="color: red; float: right;"
												path="username" /><br /> <sf:input id = "username" path="username"
												class="RegisterInput" /></td>
									</tr>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.password" /> </span> <sf:errors style="color: red; float: right;"
												path="password" /> <br /> <sf:password path="password"
												class="RegisterInput" /></td>
									</tr>
									<tr class="private_client">
										<td><span class="RegisterLabel"><s:message
													code="user.new.name" /> </span> <sf:errors style="color: red; float: right;"
												path="name" /> <br /> <sf:input path="name"
												class="RegisterInput" /></td>
									</tr>
									<tr class="private_client">
										<td><span class="RegisterLabel"><s:message
													code="user.new.surname" /> </span>
										<sf:errors style="color: red; float: right;" path="surname" /><br /> <sf:input
												path="surname" class="RegisterInput" /></td>
									</tr>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.new.email" /> </span>
										<sf:errors style="color: red; float: right;" path="email" /><br /> <sf:input
												path="email" class="RegisterInput" /></td>
									</tr>
									<tr class="company">
										<td><span class="RegisterLabel"><s:message
													code="user.new.company.name" /> </span>
										<sf:errors style="color: red; float: right;" path="comapanyName" /><br /> <sf:input
												path="comapanyName" class="RegisterInput" /></td>
									</tr>
									<tr class="company">
										<td><span class="RegisterLabel"><s:message
													code="user.new.regon" /> </span>
										<sf:errors style="color: red; float: right;" path="REGON" /><br /> <sf:input
												path="REGON" class="RegisterInput" /></td>
									</tr>
									<tr class="company">
										<td><span class="RegisterLabel"><s:message
													code="user.new.nip" /> </span>
										<sf:errors style="color: red; float: right;" path="NIP" /><br /> <sf:input
												path="NIP" class="RegisterInput" /></td>
									</tr>
									<tr class="private_client">
										<td><span class="RegisterLabel"><s:message
													code="user.new.birthdate" /> </span>
										<sf:errors style="color: red; float: right;" path="birthDate" /><br /> <sf:input
												path="birthDate" class="RegisterInput" /></td>
									</tr>

								</table></td>
							<td class="RegisterRightColumn">
								<table cellpadding="5" cellspacing="5">
									<tr class="private_client">
										<td><span class="RegisterLabel"><s:message
													code="user.new.pesel" /> </span>
										<sf:errors style="color: red; float: right;" path="PESEL" /><br /> <sf:input
												path="PESEL" class="RegisterInput" /></td>
									</tr>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.new.postalcode" /> </span>
										<sf:errors style="color: red; float: right;" path="postalCode" /><br /> <sf:input
												path="postalCode" class="RegisterInput" /></td>
									</tr>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.new.street" /></span><br /> <sf:input path="street"
												class="RegisterInput" /></td>
									</tr>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.new.city" /> </span>
										<sf:errors style="color: red; float: right;" path="city" /><br /> <sf:input
												path="city" class="RegisterInput" /></td>
									</tr>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.new.state" /></span><br /> <sf:select path="state"
												class="RegisterInput" items="${stateList}"
												itemValue="enumValue" itemLabel="value" /></td>
									</tr>
									<tr>
										<td><span class="RegisterLabel"><s:message
													code="user.new.phonenumber" /> </span>
										<sf:errors style="color: red; float: right;" path="phoneNumber" /><br /> <sf:input
												path="phoneNumber" class="RegisterInput" /></td>
									</tr>
									<tr>
										<td colspan="2" align="right"><input id="registerButton"
											type="submit"
											value="<s:message code="button.create.account" />"></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>

				</sf:form>
			</div>
			<%@ include file="footer.jsp"%>
		</div>
	</div>
	<div id="right-column-outer">
		<div id="right-column"></div>
	</div>
</body>
</html>